# 定义goods类
class Goods:
    def __init__(self, name, price):
        self.name = name
        self.price = price
    def info(self):
        print(f'名字:{self.name}单价:{self.price}')

# 定义phone类
class Phone(Goods):
    def __init__(self, name, price, brand, os):
        super().__init__(name, price)                       # 调用父类的__init__方法
        self.brand = brand
        self.os = os

    def info(self):
        super().info()
        print(self.brand)
        print(self.os)
p1 = Phone('iPhone12', 5299, 'apple', 'ios')
p1.info()

